/**********************************************
这是代码自动生成的，如果重新生成，所做的改动将会丢失
系统:gpssolution
模块:系统平台
Itop.com 版权所有
生成者：Rabbit
生成时间:2012-8-8 15:13:27
***********************************************/

using System;
using System.Threading;
using System.ComponentModel;
namespace Itop.GpsCar.Model
{
    /// <summary>
    ///[position]业务实体类
    ///对应表名:position
    /// </summary>
    [Serializable]
    public class position
    {
        
        #region Private 成员
        private long _idposition=0; 
        private DateTime _date=new DateTime(1900,1,1); 
        private string _time=String.Empty; 
        private int _device_id=0; 
        private double _longitude=0; 
        private double _latitude=0; 
        private double _altitude=0; 
        private double _speed=0; 
        private double _direction=0; 
        private int _position_type=0; 
        private int _gps_realtime_position=0; 
        private string _lbs_info=String.Empty; 
        private double _g_force=0; 
        private double _distance_from_last_gps=0; 
        private DateTime _timestamp=new DateTime(1900,1,1); 
        private string _reversed_1=String.Empty; 
        private string _reversed_2=String.Empty;   
        #endregion
  
  
        #region Public 成员
   
        /// <summary>
        /// 属性名称：idPosition
        /// 属性描述：
        /// 字段信息：[idPosition],BIGINT
        /// </summary>
        [Browsable(false)]
        [DisplayNameAttribute("")]
        public long idPosition
        {
            get { return _idposition; }
            set
            {			
                if (_idposition as object == null || !_idposition.Equals(value))
                {
                    _idposition = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：date
        /// 属性描述：Date of position info received
        /// 字段信息：[date],DATE
        /// </summary>
        [DisplayNameAttribute("Date of position info received")]
        public DateTime date
        {
            get { return _date; }
            set
            {			
                if (_date as object == null || !_date.Equals(value))
                {
                    _date = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：time
        /// 属性描述：Time of position info received
        /// 字段信息：[time],TIME
        /// </summary>
        [DisplayNameAttribute("Time of position info received")]
        public string time
        {
            get { return _time; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 0)
                throw new Exception("[Time of position info received]长度不能大于0!");
                if (_time as object == null || !_time.Equals(value))
                {
                    _time = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：device_id
        /// 属性描述：device id of position belong to
        /// 字段信息：[device_id],INT
        /// </summary>
        [DisplayNameAttribute("device id of position belong to")]
        public int device_id
        {
            get { return _device_id; }
            set
            {			
                if (_device_id as object == null || !_device_id.Equals(value))
                {
                    _device_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：longitude
        /// 属性描述：
        /// 字段信息：[longitude],DOUBLE
        /// </summary>
        [DisplayNameAttribute("")]
        public double longitude
        {
            get { return _longitude; }
            set
            {			
                if (_longitude as object == null || !_longitude.Equals(value))
                {
                    _longitude = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：latitude
        /// 属性描述：
        /// 字段信息：[latitude],DOUBLE
        /// </summary>
        [DisplayNameAttribute("")]
        public double latitude
        {
            get { return _latitude; }
            set
            {			
                if (_latitude as object == null || !_latitude.Equals(value))
                {
                    _latitude = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：altitude
        /// 属性描述：
        /// 字段信息：[altitude],FLOAT
        /// </summary>
        [DisplayNameAttribute("")]
        public double altitude
        {
            get { return _altitude; }
            set
            {			
                if (_altitude as object == null || !_altitude.Equals(value))
                {
                    _altitude = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：speed
        /// 属性描述：
        /// 字段信息：[speed],FLOAT
        /// </summary>
        [DisplayNameAttribute("")]
        public double speed
        {
            get { return _speed; }
            set
            {			
                if (_speed as object == null || !_speed.Equals(value))
                {
                    _speed = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：direction
        /// 属性描述：
        /// 字段信息：[direction],FLOAT
        /// </summary>
        [DisplayNameAttribute("")]
        public double direction
        {
            get { return _direction; }
            set
            {			
                if (_direction as object == null || !_direction.Equals(value))
                {
                    _direction = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：position_type
        /// 属性描述：0 - position by GPS, 1- position by LBS, 2 - mixed
        /// 字段信息：[position_type],INT
        /// </summary>
        [DisplayNameAttribute("0 - position by GPS")]
        public int position_type
        {
            get { return _position_type; }
            set
            {			
                if (_position_type as object == null || !_position_type.Equals(value))
                {
                    _position_type = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：gps_realtime_position
        /// 属性描述：null - unknow or LBS position, 0 - LBS, 1 - realtime GPS, 2 - Differential GPS
        /// 字段信息：[gps_realtime_position],INT
        /// </summary>
        [DisplayNameAttribute("null - unknow or LBS position")]
        public int gps_realtime_position
        {
            get { return _gps_realtime_position; }
            set
            {			
                if (_gps_realtime_position as object == null || !_gps_realtime_position.Equals(value))
                {
                    _gps_realtime_position = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：lbs_info
        /// 属性描述：LBS info: MCC|MNC|LAC|Cell ID or MCC|MNC|LAC|MCI|MCISS|NCI1|NCISS1|NCI2|NCISS2|NCI3|NCISS3|NCI4|NCISS4|NCI5|NCISS5|NCI6|NCISS6
        /// 字段信息：[lbs_info],VARCHAR
        /// </summary>
        [DisplayNameAttribute("LBS info: MCC|MNC|LAC|Cell ID or MCC|MNC|LAC|MCI|MCISS|NCI1|NCISS1|NCI2|NCISS2|NCI3|NCISS3|NCI4|NCISS4|NCI5|NCISS5|NCI6|NCISS6")]
        public string lbs_info
        {
            get { return _lbs_info; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 64)
                throw new Exception("[LBS info: MCC|MNC|LAC|Cell ID or MCC|MNC|LAC|MCI|MCISS|NCI1|NCISS1|NCI2|NCISS2|NCI3|NCISS3|NCI4|NCISS4|NCI5|NCISS5|NCI6|NCISS6]长度不能大于64!");
                if (_lbs_info as object == null || !_lbs_info.Equals(value))
                {
                    _lbs_info = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：g_force
        /// 属性描述：
        /// 字段信息：[g_force],FLOAT
        /// </summary>
        [DisplayNameAttribute("")]
        public double g_force
        {
            get { return _g_force; }
            set
            {			
                if (_g_force as object == null || !_g_force.Equals(value))
                {
                    _g_force = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：distance_from_last_gps
        /// 属性描述：distance from last valid gps point
        /// 字段信息：[distance_from_last_gps],FLOAT
        /// </summary>
        [DisplayNameAttribute("distance from last valid gps point")]
        public double distance_from_last_gps
        {
            get { return _distance_from_last_gps; }
            set
            {			
                if (_distance_from_last_gps as object == null || !_distance_from_last_gps.Equals(value))
                {
                    _distance_from_last_gps = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：timestamp
        /// 属性描述：
        /// 字段信息：[timestamp],TIMESTAMP
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime timestamp
        {
            get { return _timestamp; }
            set
            {			
                if (_timestamp as object == null || !_timestamp.Equals(value))
                {
                    _timestamp = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reversed_1
        /// 属性描述：
        /// 字段信息：[reversed_1],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reversed_1
        {
            get { return _reversed_1; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[reversed_1]长度不能大于45!");
                if (_reversed_1 as object == null || !_reversed_1.Equals(value))
                {
                    _reversed_1 = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reversed_2
        /// 属性描述：
        /// 字段信息：[reversed_2],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reversed_2
        {
            get { return _reversed_2; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[reversed_2]长度不能大于45!");
                if (_reversed_2 as object == null || !_reversed_2.Equals(value))
                {
                    _reversed_2 = value;
                }
            }			 
        }
  
        #endregion 
  
        #region 方法
        public static string Newid(){
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        public string CreateID(){
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        #endregion		
    }	
}
